<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserWalletsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('user_wallets', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->bigInteger('user_id')->unique()->comment('用户ID');
            $table->string('merchant_no', 16)->index()->comment('主体商户号');
            $table->string('wallet_user_no', 32)->index()->comment('钱包账户ID');
            $table->string('status', 16)->default(\App\Enums\WalletStatus::NOT_PAY)->comment('钱包状态');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('user_wallets');
    }
}
